class DefaultServerHttpRequestBuilder extends java.lang.Object implements ServerHttpRequest.Builder
ServerHttpRequest.Builder
.Modifier and Type | Class and Description |
---|---|
private static class |
DefaultServerHttpRequestBuilder.MutatedServerHttpRequest |
Modifier and Type | Field and Description |
---|---|
private <any> |
body |
private java.lang.String |
contextPath |
private MultiValueMap<java.lang.String,HttpCookie> |
cookies |
private HttpHeaders |
httpHeaders |
private java.lang.String |
httpMethodValue |
private ServerHttpRequest |
originalRequest |
private SslInfo |
sslInfo |
private java.net.URI |
uri |
private java.lang.String |
uriPath |
Constructor and Description |
---|
DefaultServerHttpRequestBuilder(ServerHttpRequest original) |
Modifier and Type | Method and Description |
---|---|
ServerHttpRequest |
build()
Build a
ServerHttpRequest decorator with the mutated properties. |
ServerHttpRequest.Builder |
contextPath(java.lang.String contextPath)
Set the contextPath to use.
|
private static <K,V> void |
copyMultiValueMap(MultiValueMap<K,V> source,
MultiValueMap<K,V> target) |
private java.net.URI |
getUriToUse() |
ServerHttpRequest.Builder |
header(java.lang.String key,
java.lang.String value)
Set or override the specified header.
|
ServerHttpRequest.Builder |
headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
Manipulate request headers.
|
ServerHttpRequest.Builder |
method(HttpMethod httpMethod)
Set the HTTP method to return.
|
ServerHttpRequest.Builder |
path(java.lang.String path)
Set the path to use instead of the
"rawPath" of the URI of
the request with the following conditions:
If uri is also set, the path given here
overrides the path of the given URI. |
ServerHttpRequest.Builder |
sslInfo(SslInfo sslInfo)
Set the SSL session information.
|
ServerHttpRequest.Builder |
uri(java.net.URI uri)
Set the URI to use with the following conditions:
If
path is also set, it overrides the path
of the URI provided here. |
private java.net.URI uri
private HttpHeaders httpHeaders
private java.lang.String httpMethodValue
private final MultiValueMap<java.lang.String,HttpCookie> cookies
@Nullable private java.lang.String uriPath
@Nullable private java.lang.String contextPath
private <any> body
private final ServerHttpRequest originalRequest
public DefaultServerHttpRequestBuilder(ServerHttpRequest original)
private static <K,V> void copyMultiValueMap(MultiValueMap<K,V> source, MultiValueMap<K,V> target)
public ServerHttpRequest.Builder method(HttpMethod httpMethod)
ServerHttpRequest.Builder
method
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder uri(java.net.URI uri)
ServerHttpRequest.Builder
path
is also set, it overrides the path
of the URI provided here.
contextPath
is also set, or
already present, it must match the start of the path of the URI
provided here.
uri
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder path(java.lang.String path)
ServerHttpRequest.Builder
"rawPath"
of the URI of
the request with the following conditions:
uri
is also set, the path given here
overrides the path of the given URI.
contextPath
is also set, or
already present, it must match the start of the path given here.
path
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder contextPath(java.lang.String contextPath)
ServerHttpRequest.Builder
The given value must be a valid contextPath
and it must match the start of the path of the URI of
the request. That means changing the contextPath, implies also
changing the path via ServerHttpRequest.Builder.path(String)
.
contextPath
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder header(java.lang.String key, java.lang.String value)
ServerHttpRequest.Builder
header
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
ServerHttpRequest.Builder
HttpHeaders
contains
current request headers, so that the Consumer
can
overwrite or
remove existing values, or
use any other HttpHeaders
methods.headers
in interface ServerHttpRequest.Builder
public ServerHttpRequest.Builder sslInfo(SslInfo sslInfo)
ServerHttpRequest.Builder
sslInfo
in interface ServerHttpRequest.Builder
public ServerHttpRequest build()
ServerHttpRequest.Builder
ServerHttpRequest
decorator with the mutated properties.build
in interface ServerHttpRequest.Builder
private java.net.URI getUriToUse()